package com.yssoft.entity.core;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.yssoft.entity.CommonEntity;

/**
 * 产品类别表实体类
 * t_product_classify
 * @author 
 */
@Table(name = "t_product_classify")
public class TProductClassify extends CommonEntity {
    @Id
    private Integer id;
    /**
     * 名称
     */
    private String name;

    /**
     * 编号
     */
    private String code;

    /**
     * 描述
     */
    private String described;
    /**
     * 父级类别
     */
    private Integer tPorCla;

    @Transient
    private Integer childrenSum;
    
    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
	
		return code;
	}

	public void setCode(String code) {
	
		this.code = code;
	}

	public String getDescribed() {
        return described;
    }

    public void setDescribed(String described) {
        this.described = described;
    }

	public Integer gettPorCla() {
	
		return tPorCla;
	}

	public void settPorCla(Integer tPorCla) {
	
		this.tPorCla = tPorCla;
	}

	public Integer getChildrenSum() {
	
		return childrenSum;
	}

	public void setChildrenSum(Integer childrenSum) {
	
		this.childrenSum = childrenSum;
	}

	@Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TProductClassify other = (TProductClassify) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getCode() == null ? other.getCode() == null : this.getCode().equals(other.getCode()))
            && (this.getDescribed() == null ? other.getDescribed() == null : this.getDescribed().equals(other.getDescribed()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getCode() == null) ? 0 : getCode().hashCode());
        result = prime * result + ((getDescribed() == null) ? 0 : getDescribed().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", licence_code=").append(code);
        sb.append(", described=").append(described);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}